package com.nku.mason.scm.vo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PageBean<T> implements Serializable{

	private static final long serialVersionUID = 244324436188730698L;
	
	//当前页
	private Integer page = 1;
	//页面显示记录数
	private Integer rows;
	//查询关键字
	private String keyWord;
	//总记录数
	private Integer totalCount;
	//数据列表
	private List<T> entityList;
	//查询的开始记录
	private Integer start;
	//多条件分页查询的条件实体
	private T paramEntity;
	//返回到页面的Map对象
	private Map<String, Object> pageMap = new HashMap<>();
	
	public Integer getPage() {
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public Integer getRows() {
		return rows;
	}
	public void setRows(Integer rows) {
		this.rows = rows;
	}
	public String getKeyWord() {
		return keyWord;
	}
	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}
//	public Integer getTotalCount() {
//		return totalCount;
//	}
	public void setTotalCount(Integer totalCount) {
		pageMap.put("total", totalCount);
		this.totalCount = totalCount;
	}
	
//	public List<T> getEntityList() {
//		return entityList;
//	}
	public void setEntityList(List<T> entityList) {
		pageMap.put("rows", entityList);
		this.entityList = entityList;
	}
	public Integer getStart() {
		return (page-1) * rows;
	}
	public void setStart(Integer start) {
		this.start = start;
	}
	public T getParamEntity() {
		return paramEntity;
	}
	public void setParamEntity(T paramEntity) {
		this.paramEntity = paramEntity;
	}
	public Map<String, Object> getPageMap() {
		return pageMap;
	}
//	public void setPageMap(Map<String, Object> pageMap) {
//		this.pageMap = pageMap;
//	}
	
	@Override
	public String toString() {
		return "PageBean [page=" + page + ", rows=" + rows + ", keyWord=" + keyWord + ", totalCount=" + totalCount
				+ ", entityList=" + entityList + ", start=" + start + "]";
	}

}
